--#SET TERMINATOR @
DROP TRIGGER KLASADELETE@

CREATE TRIGGER KLASADELETE 
  BEFORE DELETE ON KLASY
  REFERENCING OLD AS STARY
  FOR EACH ROW MODE DB2SQL
  BEGIN ATOMIC
    DELETE FROM HARMONOGRAMZAJEC WHERE KLASY_ID = STARY.ID;
	DELETE FROM UCZNIOWIE WHERE KLASY_ID = ID;
  END
@
  --#SET TERMINATOR ;